<?php

class LinksWidget extends HomeAction{

	//友情链接

	//参数$data[l]=调用友情链接条数

	public function render($data){

		$cache=F('link');

		if(!empty($cache)){

			$list=$cache;

		}else{

			$limit=$data['l'];

			if(!empty($limit)){

				$sql['limit']=$limit;

			}

			$sql['where']=array('status'=>1);

			$list=$this->_select('links',$sql);

			F('link',$list);

		}


		$this->assign('list',$list);

		$this->display(dirname(__FILE__).'/Links.html');

	}

}